<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

        <script type="text/javascript" src="../js/enchant.min.js"></script>
        <script type="text/javascript">
            enchant();
            
            window.onload = function(){
                var game = new Game(340,340);
                var label = new Label();
                game.preload('../images/enchant_images/bigmonster2.gif');
                game.onload = function(){
                    label.text = "haha"
                    var bear = new Sprite(80, 80);
                    var stop = new Sprite(80,80);
                    stop.image = game.assets['../images/enchant_images/bigmonster2.gif'];
                    bear.image = game.assets['../images/enchant_images/bigmonster2.gif'];
                    bear.backgroundColor = 'blue'
                    game.rootScene.addChild(bear);
                    game.rootScene.addChild(label);
                    game.rootScene.addChild(stop);
                    bear.frame = [2, 2, 3, 3];   // select sprite frame
                    stop.frame = [3, 3, 4, 4];
                    stop.addEventListener('touchstart',function(){
                        game.stop();
                    })
                     bear.addEventListener('touchstart', function() {
                        //                                    bear.x += 1;
                        bear.rotate(50);
                        //                        this.tl.moveBy(288, 0, 90)   // move right
                        //                        .scaleTo(1, 1, 10)       // turn right
                        //        
                        //                        .moveBy(-288, 0, 90)     // move left
                        //                        .scaleTo(-1, 1, 10)      // turn left
                        //                        .loop();                 // loop it
                        label.x++; 
                        console.log(bear.rotation);
                            });
                    
                    
                    //game.pushScene(bear);
                };

                game.start(); // start your game! 
            };
            function stop(){
                game.stop();
            }
        </script>

    </head>
    <body>           
    </body>
</html>
